package com.imu.purse.modules.trade.dao;

import java.util.List;
import org.apache.ibatis.annotations.Select;
import com.imu.purse.modules.trade.entity.YtfTransInEntity;
import com.imu.core.base.BaseMapper;

/**
 * IMU以太坊原生币转入表
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2018-07-09 19:42:44
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
public interface YtfTransInMapper extends BaseMapper<YtfTransInEntity>
{
	/**
     * 分页查询
     * @return
     */
	@Select({
		"<script>",
		    "SELECT id,",
					"pay_addr, ",
					"rec_addr, ",
					"rec_user_id, ",
					"rec_phone, ",
					"trans_id, ",
					"money, ",
					"time_create",
		    "FROM imu_ytf_trans_in ",
		    "WHERE 1 = 1",
			"<when test = 'payAddr != null'>",
		    	"AND `pay_addr` = #{payAddr}",
		    "</when>",
			"<when test = 'recAddr != null'>",
		    	"AND `rec_addr` = #{recAddr}",
		    "</when>",
			"<when test = 'recUserId != null'>",
		    	"AND `rec_user_id` = #{recUserId}",
		    "</when>",
			"<when test = 'recPhone != null'>",
		    	"AND `rec_phone` = #{recPhone}",
		    "</when>",
			"<when test = 'transId != null'>",
		    	"AND `trans_id` = #{transId}",
		    "</when>",
			"<when test = 'createTime != null'>",
		    	"AND `create_time` = #{createTime}",
		    "</when>",
		    "ORDER BY create_time DESC",
    	"</script>"
	})
    public List<YtfTransInEntity> findByPage(final YtfTransInEntity entity);	
}
